:: exportLib
:: Copies all the header files from the Helix dll library to the specified directory 
:: Runs as a post-build tool 
:: Also copies the appropriate helix.h file
::It is expected that this file will be called from the root Helix directory

@ECHO OFF
setlocal 
set libPath=Release
set examplePath=Examples

::Check to see if we want the debug library
if "%1"=="-d" goto setDebug
goto start

:: Set whether or not to copy the debug libtary
:setDebug
set libPath=Debug

::Start the actual script
:start

set sourcePath=HelixDLL

::copy the dll and lib file to the correct directories
echo Copying dll and lib from %libPath% to %examplePath%\%libPath%
::del %examplePath%\%libPath%\HelixDLL.dll
::del %examplePath%\%libPath%\HelixDLL.lib
::del %examplePath%\%libPath%\HelixDLL.exp
::del %examplePath%\HelixDLL.dll
::del %examplePath%\HelixDLL.lib
::del %examplePath%\HelixDLL.exp
COPY %libPath%\HelixDLL.dll %examplePath%\%libPath%\
COPY %libPath%\HelixDLL.lib %examplePath%\%libPath%\
::COPY %libPath%\HelixDLL.exp %examplePath%\%libPath%\
COPY %libPath%\HelixDLL.dll %examplePath%\
COPY %libPath%\HelixDLL.lib %examplePath%\
::COPY %libPath%\HelixDLL.exp %examplePath%\


::Remove old library files
echo Removing old header files...
rmdir /Q /S %examplePath%\Helix

echo Recreating directory structure...
::List the files (extensions) that we don't want to get coppied in a file called excludeFiles.txt
echo .cpp > excludeFiles.txt
echo .temp >> excludeFiles.txt
echo .txt >> excludeFiles.txt
echo Helix.def >> excludeFiles.txt
echo .rc2 >> excludeFiles.txt
echo HelixDLL.rc >> excludeFiles.txt
echo HelixDLL.aps >> excludeFiles.txt
echo Tools >> excludeFiles.txt


::Do the XCOPY command to copy the entire directory structure from the source directory to the output directory
@ECHO ON
xcopy %sourcePath% %examplePath%\Helix\ /s /exclude:excludeFiles.txt
@ECHO OFF

:: delete the temporary file that had the excluded file types
del excludeFiles.txt


echo Done exporting helix library.

:end